<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body th:fragment="simpleList">
<div class="setting_search tabs">
	<div class="btn-group-box" style="border-bottom:none">
		<button type="button" class="btn btn-primary" onclick="showAddSimpleList()"><i class="add"></i>添加</button>
		<button type="button" class="btn btn-default border-blue" data-toggle="modal" data-target="#batchAddSimpleList">批量添加</button>
	</div>
	<div id="advance" style="margin-left:15px">
		<div class="form-group">
			<!-- 搜索条件 -->
			<form th:action="@{/listName/edit}" method="post" id="queryForm">
				<input type="hidden" name="id" th:value="${param.id}"/>
				<input type="hidden" name="tab" th:value="simpleList"/>
				<input type="hidden" name="sPage" th:value="${listNameDto.sPage}"/>
				<input type="hidden" name="sRows" th:value="${listNameDto.sRows}"/>
				<input type="hidden" name="page" th:value="${param.page}"/>
				<input type="hidden" name="rows" th:value="${param.rows}"/>
				<!-- 查看列表项，点击页码查询时将编辑列表之前列表查询页面中的查询条件带到后台，
				再带回到前台编辑页面的backForm中，防止切换页码时返回时查询条件丢失-->
				<input type="hidden" name="name" th:value="${param.name}"/>
				<input type="hidden" name="description" th:value="${param.description}"/>
				<input type="hidden" name="enabled" th:value="${param.enabled}"/>
				<input type="hidden" name="listType" th:value="${param.listType}"/>
				<input type="hidden" name="apiName" th:value="${param.apiName}"/>
				<table class="table table-form">
					<thead>
					<tr>
						<td width="8%"></td>
						<td width="22%"></td>
						<td width="8%"></td>
						<td width="22%"></td>
						<td width="8%"></td>
						<td width="22%"></td>
					</tr>
					</thead>
					<tbody>
					<tr>
						<td align="right"><span class="form-label">列表值</span></td>
						<td>
							<input type="text" class="form-control" placeholder="请输入" name="entryValue"
								   th:value="${listNameDto.entryValue}">
						</td>
						<td align="right"><span class="form-label">描述</span></td>
						<td>
							<input type="text" class="form-control" placeholder="请输入" name="desc"
								   th:value="${listNameDto.desc}">
						</td>
						<td align="right"><span class="form-label">状态</span></td>
						<td>
							<select class="default-basic-single" style="width:100%;" name="listValueEnabled">
								<option value="">请选择</option>
								<option value="1" th:selected="${listNameDto.listValueEnabled == '1'}">启用</option>
								<option value="0" th:selected="${listNameDto.listValueEnabled == '0'}">禁用</option>
							</select>
						</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td colspan="5">
							<a href="javascript:void(0);" class="btn btn-primary" id="btnQuery">查询</a>
							<a href="javascript:void(0);" class="btn btn-default border-blue" style="margin-left:15px;"
							   id="btnReset">清空</a>
						</td>
					</tr>
					</tbody>
				</table>
			</form>
		</div>
	</div>
	<div class="group-box">
		<table class="table table-bordered table-striped table-condensed table-hover" style="table-layout: fixed;">
			<thead>
				<tr>
					<th width="15%">列表值</th>
					<th width="20%">描述</th>
					<th width="8%">排序编号</th>
					<th width="20%">apiName</th>
					<th width="6%">状态</th>
					<th width="13%">创建时间</th>
					<th width="13%">更新时间</th>
					<th width="5%">操作</th>
				</tr>
			</thead>
			<tbody id="simpleListTable">
				<tr ondblclick="edit(this)" th:each="entity : ${simpleListMap?.get('rows')}">
					<td hidden="true" field="id" th:text="${entity.id}"></td>
					<td hidden="true" field="listId" th:text="${entity.listId}"></td>
					<td hidden="true" field="parentId" th:text="${entity.parentId}"></td>
					<td hidden="true" field="enabled" th:text="${entity.enabled}"></td>
					<td field="entryValue" th:title="${entity.entryValue}" th:text="${entity.entryValue}"></td>
					<td field="description" th:title="${entity.description}" th:text="${entity.description}"></td>
					<td field="sortNumber" th:title="${entity.sortNumber}" th:text="${entity.sortNumber}"></td>
					<td field="apiName" th:title="${entity.apiName}" th:text="${entity.apiName}"></td>
					<td th:title="${entity.enabled == 0 ?'禁用':'启用'}" th:text="${entity.enabled == 0 ?'禁用':'启用'}"></td>
					<td th:title="${entity.createTime}" th:text="${entity.createTime}"></td>
					<td th:title="${entity.updateTime}" th:text="${entity.updateTime}"></td>
					<td>
						<a class="action" name="edit"><i class="glyphicon glyphicon-edit"></i></a>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>
<div class="page-msg">共<span th:text="${simpleListMap.total}"></span>记录</div>
<ul class="pagination" id="rolePagination"></ul>
<input type="hidden" id="simpleListTotal" th:value="${simpleListMap?.total}">
<input type="hidden" id="entityApiName" th:value="${entity?.apiName}">
</body>
</html>